<template>
    <div class="c-panel login">
 <el-form :inline="true" :model="formInline" class="demo-form-inline">
 <el-form-item label="楼栋名称">
    <el-input v-model="formInline.buildingname" placeholder="楼栋名称"></el-input>
  </el-form-item>
  <br>
 <el-form-item label="楼栋编号">
    <el-input v-model="formInline.buildingnumber" placeholder="楼栋编号"></el-input>
  </el-form-item>
  <br>
   <el-form-item label="楼层">
    <el-input v-model="formInline.floor" placeholder="楼层"></el-input>
  </el-form-item>
  <br>
   <el-form-item label="分户房屋">
    <el-input v-model="formInline.count" placeholder="分户房屋"></el-input>
  </el-form-item>
  <br>
   <el-form-item label="总面积">
    <el-input v-model="formInline.totalarea" placeholder="总面积"></el-input>
  </el-form-item>
  <br>
  <el-form-item>
     <el-form-item label="描述">
    <el-input v-model="formInline.description" placeholder="描述"></el-input>
  </el-form-item>
  </el-form-item>
  <br>
  <el-form-item>
    <el-button type="primary" @click="onSubmit">添加楼盘</el-button>
  </el-form-item>
</el-form>
    </div>
</template>
<script>
export default {
    name:"addBuilding",
     props:['params'],
    data(){
       return{
           formInline:{
            houseList:[{}],
            buildingname:"",
            buildingnumber:"",
            floor:"",
            count:"",
            totalarea:"",
            description:"",
            hid:""
           }
       }
    },
mounted () {
    // this.showAllHouse();
},
    methods:{
      onSubmit(){
        var the = this ;
        this.sa.ajax("/building/addBuilding",
            {
                buildingname:the.formInline.buildingname,
            buildingnumber:the.formInline.buildingnumber,
            floor:the.formInline.floor,
            count:the.formInline.count,
            totalarea:the.formInline.totalarea,
            description:the.formInline.description,
            hid:this.params.hid
            },
            function(data){
                if(data.data!=null){
                  var tab = {id: 'houseDetail', name: '详细信息', view: () => import('@/sa-view/WmtbuildManager/houseDetail.vue'),  params:{hid:the.params.hid}};
            this.sa_admin.showTab(tab);
                }
            }.bind(this)
            )

}

    }
}
</script>
<style scoped>
.login{
  width: 400px;
  height: 900px;
  /* 把元素变成定位元素 */
  position: absolute;
  /* 元素距离上，左都为50% */
  left: 50%;
  top: 30%;
  /* 让元素的左外边距，上外边距为元素宽高的1/2 注意margin是负距*/
  margin-top: -150px;
  margin-left: -200px;
  text-align: center
}
</style>